package moc.egg;
import moc.compiler.*;
import moc.tds.*;
import moc.type.*;
import moc.gc.*;
import java.util.*;
import mg.egg.eggc.runtime.libjava.lex.*;
import mg.egg.eggc.runtime.libjava.*;
import mg.egg.eggc.runtime.libjava.messages.*;
import mg.egg.eggc.runtime.libjava.problem.IProblem;
import java.util.Vector;
public class S_PARF_MOC {
LEX_MOC scanner;
  S_PARF_MOC() {
    }
  S_PARF_MOC(LEX_MOC scanner, boolean eval) {
    this.scanner = scanner;
    this.att_eval = eval;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  SIGNATURE att_hsignature;
  int att_depLB;
  int att_hdepLB;
  boolean att_eval;
  IMachine att_machine;
  DTYPE att_type;
  SIGNATURE att_signature;
  LEX_MOC att_scanner;
  private void regle9() throws Exception {

    //declaration
    S_TYPE_MOC x_2 = new S_TYPE_MOC(scanner,att_eval) ;
    T_MOC x_3 = new T_MOC(scanner ) ;
    //appel
if  (att_eval)      action_auto_inh_9(x_2, x_3);
    x_2.analyser() ;
    x_3.analyser(LEX_MOC.token_ident);
if  (att_eval)      action_type_9(x_2, x_3);
  }
private void action_auto_inh_9(S_TYPE_MOC x_2, T_MOC x_3) throws Exception {
try {
// instructions
x_2.att_machine=this.att_machine;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#auto_inh","PARF -> TYPE ident #type ;"});
}
  }
private void action_type_9(S_TYPE_MOC x_2, T_MOC x_3) throws Exception {
try {
// locales
int loc_ad;
// instructions
this.att_type=x_2.att_type;
loc_ad=(this.att_hdepLB-x_2.att_type.getTaille());
if ((this.att_hsignature.containsKey(x_3.att_txt))){
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMOCMessages.id_Meme_ident_signature, MOCMessages.Meme_ident_signature,new Object[]{""+x_3.att_txt});

}
else {
this.att_hsignature.put(x_3.att_txt,  new INFOVAR(x_2.att_type,  new Emplacement(loc_ad, this.att_machine.getRegister())));
this.att_signature=this.att_hsignature;
this.att_depLB=loc_ad;
}
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#type","PARF -> TYPE ident #type ;"});
}
  }
  public void analyser () throws Exception {
    regle9 () ;
  }
  }
